Skip to content

feat: add composed types support (union/intersection) - #106

Merged
Vincent Biret (baywet) merged 1 commit into
microsoft:mainfrom
andreaTP:feat/composed-type-support
Aug 19, 2026
Merged

feat: add composed types support (union/intersection)#106
Vincent Biret (baywet) merged 1 commit into
microsoft:mainfrom
andreaTP:feat/composed-type-support

Conversation

@andreaTP

Copy link
Copy Markdown
Contributor

Add infrastructure needed for the Kiota generator to emit composed type code for union and intersection types:

  • Add write_object_value to SerializationWriter interface with variadic additional_values_to_merge parameter
  • Add ComposedTypeWrapper marker module for generated wrapper classes
  • Add ParseNodeHelper.merge_deserializers_for_intersection_wrapper for merging field deserializers across intersection type members

Add infrastructure needed for the Kiota generator to emit composed type
code for union and intersection types:

- Add write_object_value to SerializationWriter interface with variadic
  additional_values_to_merge parameter
- Add ComposedTypeWrapper marker module for generated wrapper classes
- Add ParseNodeHelper.merge_deserializers_for_intersection_wrapper for
  merging field deserializers across intersection type members

@baywet Vincent Biret (baywet) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

@baywet

Copy link
Copy Markdown
Member

(holding the merge for now until we get the corresponding generation PR)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds core abstractions needed for Kiota’s Ruby generator to emit code for composed types (union/intersection), by extending serialization capabilities, introducing a marker module for generated wrapper types, and providing a helper for combining intersection deserializers.

Changes:

  • Add SerializationWriter#write_object_value(key, value, *additional_values_to_merge) to support composed-type serialization scenarios.
  • Introduce MicrosoftKiotaAbstractions::ComposedTypeWrapper as a marker module for generated wrapper classes.
  • Add ParseNodeHelper.merge_deserializers_for_intersection_wrapper and accompanying specs to merge field deserializers across intersection members.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
spec/parse_node_helper_spec.rb Adds specs for the new marker module, writer API addition, and deserializer-merging helper behavior.
lib/microsoft_kiota_abstractions/serialization/serialization_writer.rb Extends the serialization writer interface with write_object_value (variadic merge inputs).
lib/microsoft_kiota_abstractions/serialization/parse_node_helper.rb Adds helper to merge get_field_deserializers hashes for intersection wrappers.
lib/microsoft_kiota_abstractions/serialization/composed_type_wrapper.rb Adds empty marker module for composed-type wrapper classes.
lib/microsoft_kiota_abstractions.rb Wires the new helper and marker module into the main require list.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@andreaTP

Copy link
Copy Markdown
Contributor Author

This one ?

@baywet

Copy link
Copy Markdown
Member

This one ?

yes

@andreaTP

Andrea Peruffo (andreaTP) commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

Vincent Biret (@baywet) are you waiting for something from me on this one?

Ideally we should merge the 2 PRs to the gems and, when, the gems are available I'd be able to finalize the PR in kiota.

Or do you have an alternative flow in mind?

@baywet
Vincent Biret (baywet) merged commit 039b8ae into microsoft:main Aug 19, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants